Subject: Re: SAS C 6.0 weirdness with __inline
From: [email-masked] (Holger Kruse )
Date: 19 Oct 92 12:14:47 GMT
Newsgroups: comp.sys.amiga.programmer

[email-masked] (Robert Peter Poole) writes:

>I've been trying to write code to take advantage of the __inline feature of
>SAS C 6.0.  For example

>int __inline foo(int uplim)
>{
>	return((rand48() >> 3) % uplim);
>}

>Or something similar.  Now, it compiles fine, but when I go to use the linker,
>slink gives an error!  Can't find the symbol, etc.

>What gives?  Is there some special linker option I should set to use inline
>function declarations?

>I'd be asking EMITS this question, except that I rather intelligently left
>my old registration number back home (and I'm here at grad school with no
>way to check it).

>Ah, well, perhaps someone has had the same problem?

Yes, I had the same problem. When you use the global Optimizer and call
the __inline-function ONLY from the module where it has been defined,
everything works fine. But if you compile without global optimizer or
call the function from a different module, the linker will complain about
an undefined symbol.
At least this was my experience.

I reported that bug via EMITS about a week ago.

>Rob Poole
>[email-masked]
>[email-masked]

Holger Kruse
[email-masked]